'use strict';

const Service = require('egg').Service;

class UserService extends Service {
    //注册
    async registry(username,hmcPwd) {
        await this.app.mysql.query('insert into userlist (username,password) values (?,?)',[username,hmcPwd])
    }
    //排重
    async selectUser(username){
        return await this.app.mysql.query('select * from userlist where username=?',[username])
    }
    //登录
    async login(username,hmcPwd){
        return await this.app.mysql.query('select * from userlist where username=? and password=?',[username,hmcPwd])
    }
}

module.exports = UserService;
